﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.IO;

namespace mds.NoSqlDatabase
{
    [ServiceContract(Namespace = "mds.Cassandra.ServiceContract.CassandraProvider")]
    public interface ICassandraProvider
    {
        [OperationContract(Name = "AddkeySpace")]
        bool AddkeySpace(string keySpace,string host);
        [OperationContract(Name = "DeleteSpace")]
        bool DeleteSpace(string keySpace,string host);
        [OperationContract(Name = "GetSpaces")]
        String[] GetSpaces(string host);
        [OperationContract(Name = "CreateTable")]
        bool CreateTable(String table, string keySpace, Dictionary<String, String> columns,string host);
        [OperationContract(Name = "DropTable")]
        bool DropTable(String table, string keySpace,string host);
        [OperationContract(Name = "GetTables")]
        String[] GetTables(string keySpace,string host);       
        [OperationContract(Name = "AddFile")]
        Guid AddFile(CassandraFile fileData,string host);
        [OperationContract(Name = "AddFiles")]
        Dictionary<Guid, bool> AddFiles(CassandraFile[] fileData,string host);
        [OperationContract(Name = "AddBlockSingleSpace")]
        Dictionary<Guid, bool> AddBlockSingleSpace(CassandraFile[] fileData, String keySpace,string host);
        [OperationContract(Name = "DropFile")]
        bool DropFile(Guid fileId, string keySpace,string host);
        [OperationContract(Name = "GetFile")]
        CassandraFile GetFile(Guid fileId, string keySpace,string host);
        [OperationContract(Name = "GetFileInfo")]
        CassandraFileInfo GetFileInfo(Guid fileId, string keySpace,string host);
        [OperationContract(Name = "GetFileInfos")]
        CassandraFileInfo[] GetFileInfos(Guid[] fileId, string keySpace,string host);
        [OperationContract(Name = "AppendLog")]
        void AppendLog(String logContent, String applcationName, String ip, string host);
        [OperationContract(Name = "GetLogs")]
        CassandraErrorInfo[] GetLogs(String applcationName, string errorType, DateTime startTime, DateTime endTime, string host);

            [OperationContract(Name = "AppendErrorLog")]
        void AppendErrorLog(string ApplicationName, DateTime CreateTime, string Host, string Id, string Ip, string Mac, string Message, DateTime ModifyTime, string Source, string SourceObject, int StatuCode, string Type, string host);
    }
}
